<?php
namespace voxfa\system;

require_once dirname(__FILE__)."/process/process.php";

use voxfa\system\process;

class System {

	/**
	 * @return process\process
	 * @param unknown_type $command
	 */
	static public function createProcess($command,$cwd){
		$desc = array(
		'input'=>array('pipe','r'),
		'output'=>array('pipe','w'),
		'error'=>array('pipe','w')
		);
		$new = new process\process($command,$desc,$cwd);
		$new->open();
		//wait for open
		if(!$new->isRun())
			throw new RuntimeException($new->getError(),$new->getExitcode());
			
		return $new;
	}	
}